package br.com.sgi.dao;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;

import org.hibernate.Session;

import br.com.sgi.model.Entidade;


public abstract class DaoAbstrato<T extends Entidade> implements DaoGenerico<T> {

	private EntityManager entityManager;

	private EntityTransaction transaction;

	private Session session;

	private Class<T> classePersistente;

	private final Type genericSuperclass;

	private final ParameterizedType parameterizedType;
	
	/**
	 * Contrutor que guarda o tipo atual da Classe T.
	 */
	public DaoAbstrato() {
		genericSuperclass = getClass().getGenericSuperclass();
		parameterizedType = ((ParameterizedType) genericSuperclass);
		classePersistente = (Class<T>) parameterizedType.getActualTypeArguments()[0];
	}

	
	public void save(T objeto){
		
	}
	
	
	
}
